﻿using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;

namespace Chambills.PopUpBehavior
{
    public static class DependencyObjectExtensions
    {
        public static IEnumerable<DependencyObject> VisualChildren(this DependencyObject me)
        {
            int childrenCount = VisualTreeHelper.GetChildrenCount(me);

            for (int i = 0; i < childrenCount; i++)
            {
                yield return VisualTreeHelper.GetChild(me, i);
            }

        }
    }
}